package com.atguigu.srb.mq.service.impl;

import com.atguigu.srb.mq.service.MqService;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author lsyandwh
 * @create 2022-12-19 16:16
 */
@Service
public class MqServiceImpl implements MqService {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Override
    public void sendMessage(String exchange, String key, String message) {

        rabbitTemplate.convertAndSend(exchange,key,message);
    }
}
